<?php
namespace App\Controllers\Member;

use App\Libs\Helper\CommonHelper;
use App\Models\Tag\Tags;
use App\Models\User\User;
use App\Libs\Views\Json;
use App\Models\Member\MemOrder;
use App\Models\Expand\Tixian_log;
use App\Libs\Message\Message;

/**

 */
class TixianArrive extends \App\Libs\Base\BaseAction
{
    protected function beforeRun()
    {
        parent::beforeRun();
        $this->needLogin = FALSE;
    }


    public function execute()
    {
        if(!$this->request->hasQuery('log_id')){
            return Json::view(1,'哪条提现记录到账了？',[]);
        }

        $log_id = $this->request->getQuery('log_id');
        $matchLog = Tixian_log::findOne($log_id);
        $matchLog->status = '1';
        if($matchLog->save()){
            //发消息
            $user =User::findOne($matchLog->uid);
            $type = 'tixiandaozhang';
            $data = [
                'bank' =>$matchLog->account,
                'money' => $matchLog->money
            ];
            Message::addMsg($type,$data,$user);
            return Json::view(0,'成功',[]);
        }else{
            return Json::view(1,'系统忙，请稍后',[]);
        }









        return Json::view(0,'ok',$matchLog);
    }
}
